<?php
// +----------------------------------------------------------------------
// | User: DaMing
// +----------------------------------------------------------------------
// | Email: 3228985941@qq.com
// +----------------------------------------------------------------------
// | Date: 2022/6/12
// +----------------------------------------------------------------------
// | Time: 21:51
// +----------------------------------------------------------------------
namespace app\dao;


use app\dm\basic\BaseDao;
use app\model\SysAdminModel;

class SysAdminDao extends BaseDao
{
    /**
     * 设置模型
     * @return string
     */
    protected function setModel(): string
    {
        return SysAdminModel::class;
    }

    /**
     * 获取列表
     * @param array $where
     * @param int $page
     * @param int $limit
     * @return mixed
     */
    public function getList(array $where, int $page, int $limit)
    {
        return $this->search($where)->page($page, $limit)->select()->toArray();
    }


    public function getAdmin($id)
    {
        return $this->getOne(['id' => $id, 'deleted' => 0]);
    }
}